package com.smile.utils;

import java.util.Map;

/**
 * <p>转换参数工具类</p>
 *
 * @author hzhan
 */
public class ConvertParamUtils {

    /**
     * <p>将map对象键值对转成url连接参数</p>
     *
     * @param map
     * @return
     */
    public static String covertToUrlParams(Map<String, String> map) {
        StringBuilder result = new StringBuilder("?");
        for (Map.Entry<String, String> entry : map.entrySet()) {
            result.append(entry.getKey()).append("=").append(entry.getValue()).append("&");
        }
        return result.toString();
    }


}
